//TestScriptBlock.block
importPackage(com.blocks.blocks);
importPackage(com.blocks);
importPackage(com.blocks.model);
importPackage(com.jme3.math);
importPackage(java.lang);
importPackage(com.blocks.script);
importPackage(com.blocks.gui);

var block = new Object(); 
var counter = 0;
var color = 0 ; //0-5
var direction = 0;
block.setup = function(name) {
 	thisBlock.setName("FrequencyGenerator");
 	thisBlock.setTextureRow(0.0);
	thisBlock.setTextureColumn(4.0);
 	thisBlock.resetTexture();
	thisBlock.setCustomFrequency(true);
	thisBlock.setBlockListGroup(BlockListGroup.FREQUENCY);
  } 
block.loop = function(name, tpf) { 
	if(counter>=1 && thisBlock.isPowered()){		
					
		//thisBlock.setFrequency(BlockSides.SIDE_ABOVE, color);	
		thisBlock.setFrequency(BlockSides.SIDE_ABOVE, color++%6);	
		thisBlock.setFrequency(BlockSides.SIDE_BELOW, color++%6);	
		thisBlock.setFrequency(BlockSides.SIDE_FRONT, color++%6);	
		thisBlock.setFrequency(BlockSides.SIDE_BACK, color++%6);	
		thisBlock.setFrequency(BlockSides.SIDE_LEFT, color++%6);	
		thisBlock.setFrequency(BlockSides.SIDE_RIGHT, color++%6);
		color++;
		
		counter = 0;
	}
	counter = counter+tpf;
 }


block.scriptExport = function() {
	return ("");
} 

